package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AccountDetailssMapper;
import com.ruoyi.system.domain.AccountDetailss;
import com.ruoyi.system.service.IAccountDetailssService;

/**
 * 账户详情Service业务层处理
 * 
 * @author he
 * @date 2025-10-20
 */
@Service
public class AccountDetailssServiceImpl implements IAccountDetailssService 
{
    @Autowired
    private AccountDetailssMapper accountDetailssMapper;

    /**
     * 查询账户详情
     * 
     * @param id 账户详情主键
     * @return 账户详情
     */
    @Override
    public AccountDetailss selectAccountDetailssById(Long id)
    {
        return accountDetailssMapper.selectAccountDetailssById(id);
    }

    /**
     * 查询账户详情列表
     * 
     * @param accountDetailss 账户详情
     * @return 账户详情
     */
    @Override
    public List<AccountDetailss> selectAccountDetailssList(AccountDetailss accountDetailss)
    {
        return accountDetailssMapper.selectAccountDetailssList(accountDetailss);
    }

    /**
     * 新增账户详情
     * 
     * @param accountDetailss 账户详情
     * @return 结果
     */
    @Override
    public int insertAccountDetailss(AccountDetailss accountDetailss)
    {
    accountDetailss.setCreateUserId(SecurityUtils.getUserId());
    accountDetailss.setCreateUserName(SecurityUtils.getUsername());
        accountDetailss.setCreateTime(DateUtils.getNowDate());
        return accountDetailssMapper.insertAccountDetailss(accountDetailss);
    }

    /**
     * 修改账户详情
     * 
     * @param accountDetailss 账户详情
     * @return 结果
     */
    @Override
    public int updateAccountDetailss(AccountDetailss accountDetailss)
    {
        accountDetailss.setUpdateTime(DateUtils.getNowDate());
    accountDetailss.setUpdateUserId(SecurityUtils.getUserId());
    accountDetailss.setUpdateUserName(SecurityUtils.getUsername());
        return accountDetailssMapper.updateAccountDetailss(accountDetailss);
    }

    /**
     * 批量删除账户详情
     * 
     * @param ids 需要删除的账户详情主键
     * @return 结果
     */
    @Override
    public int deleteAccountDetailssByIds(Long[] ids)
    {
        return accountDetailssMapper.deleteAccountDetailssByIds(ids);
    }

    /**
     * 删除账户详情信息
     * 
     * @param id 账户详情主键
     * @return 结果
     */
    @Override
    public int deleteAccountDetailssById(Long id)
    {
        return accountDetailssMapper.deleteAccountDetailssById(id);
    }

    @Override
    public void insertAccountDetailssList(List<AccountDetailss> accountDetailsses) {
        accountDetailssMapper.insertAccountDetailssList(accountDetailsses);
    }
}
